<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
  <TITLE>Advanced Programming in the UNIX Environment</TITLE>
  <STYLE type="text/css">
  body {
  background-color: #FFFFFf;
  }
  </STYLE>

</HEAD>

<BODY>
  <TABLE border="1" align="center" cellpadding="15">
    <TR>
      <TD valign="top">
        <H2>Advanced Programming in the UNIX Environment</H2>
	<H3>CS631 - APUE</H3>
	<hr>
	<H3><a name="outline"></a>Course Outline</H3>

        <P>In this course, students will learn to develop complex
        system-level software in the C programming language while gaining
        an intimate understanding of the Unix operating system (and
        all OS that belong to this family, such as Linux, the BSDs, and
        even Mac OS X) and its programming environment.
        </P>
        <P>
        Topics covered will include the user/kernel
        interface, fundamental concepts of Unix, user
        authentication, basic and advanced I/O, fileystems, signals,
        process relationships, and interprocess communication.
        Fundamental concepts of software development and
        maintenance on Unix systems (development and debugging
        tools such as "make" and "gdb") will also be covered.</P>

	<P><b>Students are expected to have a good working knowledge
	of the C programming language, have written non-trivial
	programs before, and to be able to competently use a Unix 
	system with a command-line shell interface.
	<em>All coursework will be done exclusively on a Unix system
	from the command-line.</em>  This is <em>not</em> an
	introduction to using Unix!</b></P>

	<P>If you email me to waive the prerequisites, please provide
	information about how you meet the requirements listed above in
	bold.  (This has the added benefit of showing that you've actually
	read at least this far on this page.)</p>

        <P>This class overlaps <em>significantly</em> with
	CS392 ``Systems Programming'' -- if you have taken this class,
        please talk to me in person before trying to register for CS631.</P>

	<hr>
	<table width="100%" border="0">

	<tr><td width="50%" valign="top">

        <H3><a name="time"></a>Time, Date &amp; Place:</H3>
	<p><b>Interactive/synchronous: Mondays, 18:15 - 20:45 Eastern, <a href="https://stevens.zoom.us/j/91309973136">via Zoom</a></b><br>
		<b>Online on-demand: anytime <a
href="https://v.gd/cs631apue">via YouTube video
lectures</a></b></p>


        <H3><a name="instructor"></a>Instructor:</H3><A href=
        "https://stevens.netmeister.org">Jan Schaumann</A>
        [<A href=
        "mailto:jschauma@stevens.edu">jschauma@stevens.edu</A>]

        <p><small>When emailing me, please use your @stevens.edu address.
          I will likely not even see your email if it is sent from gmail
          or any other non-stevens address.</small></p>


        <!-- <H3><a name="ta"></a>TA:</h3>
        Patrick Murray [<a href="mailto:pmurray1@stevens.edu">pmurray1@stevens.edu</a>] -->
	<hr>

        <H3><a name="resources"></a>Resources:</H3>

	<p>Content and discussions:
	<ul>
          <LI><A href=
          "https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue">CS631APUE Mailinglist</a><br>
	  <em>Note: all class communications happen via this mailing
list.</em><br>
	  All registered students are subscribed to this list using their
	  <tt>@stevens.edu</tt> address.  It is critical that you read this list.</li>
	  <li><a href="https://cs631apue.slack.com/">Course Slack</a></li>
	  <li><a href="https://v.gd/cs631apue">Course Videos / Youtube Channel</a></li>
	</ul>

	<p>Assignments and meta-information:
	<ul>
	  <li><a href="#syllabus">Course Syllabus</a></li>
          <LI><A href="hw">General Homework Guidelines</a></li>
	  <LI><A href="style">Source Code Style Guide</A></li>
	  <LI><A href="checklist">Code Submission Checklist</A></li>
	  <LI><a href="#source-code">Links to OS Source Code</a></li>
	  <li><a href="#books">Textbooks used in this class</a></li>
	  <li><a href="#systems">Systems used in this class</a></li>
	  <li><a href="#grading">Grading Policies</a></li>
	  <li><a href="#hw">Homework Assignments</a></li>
	  <li><a href="#midterm">Midterm Project</a></li>
	  <li><a href="#group-project">Group Project</a></li>
	</ul>
	</p>

	<p>Related links and documents:
        <UL>
	  <LI><A href="text">Writing ASCII Text</A></li>
          <LI><A href=
          "http://man.netbsd.org/cgi-bin/man-cgi/man">
          NetBSD Manual Pages</A></LI>

          <LI><A href="http://pubs.opengroup.org/onlinepubs/9699919799/">Single UNIX Specification</A> (POSIX)</LI>
	  <LI><a href="https://twitter.com/cs631apue">Class Twitter
Account</a></li>
	  <LI><a href="apue-code.tar.gz">All Code Examples</a></li>
	  <!-- <LI><a href="video.html">Lecture recordings</a></li> -->
	  <li><a href="https://github.com/jschauma/cs631apue">Raw course
material on GitHub</a></li>
          <li><a href="git.html">Using git</a></li>
        </UL>
	</p>

	<p>Tool Tips:
	<ul>
	  <li><a href="https://youtu.be/TWog5NklSws">ctags(1)</a> [<a href="tt/ctags/tt-ctags.pdf">slides</a>]&nbsp;[<a href="tt/ctags/tt-ctags.txt">transcript</a>]
	  <li><a href="https://youtu.be/vxTXXaCr4s8">screen(1)</a> [<a href="tt/screen/tt-screen.pdf">slides</a>]&nbsp;[<a href="tt/screen/tt-screen.txt">transcript</a>]
	  <li><a href="https://youtu.be/XqhOUqi4fc0">/usr/share/docs</a> [<a href="tt/screen/tt-docs.pdf">slides</a>]&nbsp;[<a href="tt/screen/tt-docs.txt">transcript</a>]
	</ul>

	</td><td valign="top" align="right">
<a class="twitter-timeline" data-dnt="true"
href="https://twitter.com/cs631apue"
data-widget-id="373910139234832384">Tweets by @cs631apue</a>
<script>!function(d,s,id){var
js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

	<td>
	</td></tr>
	</table>

	<hr>
	<h3><a name="source-code">Source Code</a></h3>

        <P>You will be writing a lot of code in this class. You may
        also find the need to <em>read</em> a lot of code not written by you
        as well as the manual pages accompanying the sources.</p>

	<p>Our primary reference platform being
	NetBSD, you can install the full sources into
	<a href="virtualbox/">your VM</a> via e.g., <a
	href="fetch-sources.sh">this script</a>.</p>

	<p>To browse or fetch sources for other Open
	Source Unix variations, please see these
	links:</p>

	<p>
	<ul>
	<li><a href="http://sources.debian.net/">Debian</a></li>
	<li><a href="http://svnweb.freebsd.org/">FreeBSD</a></li>
	<li><a href="http://ftp.gnu.org/gnu/coreutils/">GNU coreutils</a></li>
	<li><a href="https://github.com/illumos/illumos-gate/tree/master/usr/src">illumos</a> (OpenSolaris derivative)</li>
	<li><a href="http://cvsweb.netbsd.org/bsdweb.cgi/src/">NetBSD</a></li>
	<li><a href="http://www.openbsd.org/cgi-bin/cvsweb/">OpenBSD</a></li>
	</ul>


	<hr>
        <H3><a name="books"></a>Textbooks:</H3>

        <P>The textbook used in this class is:

        <UL>
          <LI>
          ``<A href=
          "http://www.apuebook.com/about3e.html">
          Advanced Programming in the UNIX&#174;
          Environment</A>'', Third Edition<BR>
          W. Richard Stevens, Stephen A. Rago<BR>
          ISBN: 0-321-63773-9<BR>
          Publisher: Addison Wesley Professional<BR>
          <A href=
          "http://www.apuebook.com/code3e.html">Code
          Examples</A> | <a href="http://proquest.safaribooksonline.com/book/programming/unix/9780321638014">Safari Online version</a><BR></LI>
	</UL>
	</p>

	<p>
        The following books are recommended purely for your own personal
        reference.  They're not used in the class as a text, but are
        related and very useful books to have:
	<UL>
          <LI>
          ``<A href="http://amzn.com/0131103628">The C
          Programming Language</A>'' -- <EM>important</EM>: make
          sure you get the <STRONG>2nd Edition</STRONG> covering
          <STRONG>ANSI C</STRONG>.<BR>
          by Brian W. Kernighan and Dennis M. Ritchie.<BR>
          Prentice Hall, Inc., 1988.<BR>
          ISBN 0-13-110362-8 (paperback), 0-13-110370-9
          (hardback).<BR></LI>
          <LI>
          ``<a href="http://www.cs.princeton.edu/~bwk/tpop.webpage/">The Practice of
          Programming</a>''<br>
          by Brian W. Kernighan and Rob Pike.<BR>
          Addison-Wesley, Inc., 1999.<BR>
          ISBN 0-201-61586-X. <BR>
          </LI>
        </UL>

	<hr>
	<H3><a name="systems"></a>Systems Used</H3>
	<p>All software development will be done on a <a
	href="https://www.netbsd.org">NetBSD</a> system.  It is
	your responsibility to gain access to such a system <b>prior
	to the start of the class</b>.  Please see <a href="netbsd.html">this
	page</a> for more information. <a href="virtualbox/">Instructions on how to install NetBSD in a VirtualBox VM are provided to you here.</a></p>
	<p>
	<p>All grading will be done on a NetBSD 9.0 system.  While you may
	choose to develop on your own personal host, you should make sure
	that your code compiles and runs flawlessly on this OS version.</p>

	<p>
	You may also find it useful to
get yourself an account on the
<a href="linux-lab.html">Stevens linux-lab systems</a>
to be able to compare another system.
	</p>

	<hr>
        <H3><a name="grading"></a>Grading:</H3>There will most likely be:
        <UL>
	  <LI>course participation and <a href="course-notes.html">class notes</a>: 50 points</LI>

          <LI>2 homework assignment, worth 25 points each</LI>

          <LI>1 midterm project, worth 100 points</LI>

          <LI>1 group project, worth 200 points</LI>

          <LI>1 final assignment, worth 100 points</LI>

          <!-- <LI>1 final exam, worth 100 points</LI> -->

          <LI>no make-up assignments</LI>
          <LI>no extra credit</LI>
          <LI>no curve</LI>
        </UL>

	Letter grades will be given as follows:
        <UL>
          <LI>90% - 100% of total available points =&gt; A</LI>
          <LI>80% - 90% of total available points =&gt; B</LI>
          <LI>70% - 80% of total available points =&gt; C</LI>
          <LI>0 - 70% of total available points =&gt; F</LI>
        </UL>

	Within each letter grade, there are +/- grades given at the
	discretion of the instructor. (Exception: there is no A+)

	<H4><a name="cheating"></a>Plagiarism, Cheating and other ways to get an F</H4>
	This really should not be necessary, but just to preempt any complains
	that I did not make myself clear:
	<blockquote>
	Students are responsible for their own work.  It is unethical (and in
	some cases illegal) to present as one's work the ideas, words or
	representations of another without the proper indication of the
	source.  Therefore, it is the student's responsibility to give credit
	for any quotation, idea or data (such as statistical data or source
	code) borrowed from an outside source.
	<br><br>
	Failure to do so constitutes <a
href="https://www.netmeister.org/blog/plagiarism.html">plagiarism</a>, may imply copyright
	infringement and license violations and is viewed as cheating
	in this class.
	</blockquote>
  Any incidents are reported to the Dean of Graduate
	Academics, as per the <a
href="https://www.stevens.edu/sites/stevens_edu/files/Graduate-Student-Code-Academic-Integrity.pdf">Graduate
Student Code of Academic Conduct</a>.

	<hr>
        <H3><A name="hw">Homework</A> Assignments:</H3>
	<p>Assignments will be posted as the semester progresses.</p>
	<p><ul>
		<li><a href="course-notes.html">Class notes</a></li>
		<li><a href="f20-hw1.html">HW#1: trivially copy a file</a></li>
		<li><a href="f20-hw2.html">HW#2: implement the <tt>command(3)</tt> library function</a></li>
<!--		<li><a href="f19-hw1.html">HW#1: trivially copy a file</a></li>
		<li><a href="f19-sish.html">Final assignment: write a simple shell</a></li>
		<li><a href="intro.html">Intro "test"</a></li>
		<li><a href="f16-hw1.html">HW#1: read code</a></li>
		<li><a href="f16-hw3.html">HW#3 - sws milestone#1</a></li>
		<li><a href="f16-hw4.html">HW#4 - Encryption/decryption</a></li>
		<li><a href="f15-hw3.html">HW#3: webserver framework</a></li>
		<li><a href="f15-aed.html">"HW#4": write a simple tool to perform encryption/decryption of content</a></li>
		<li><a href="f14-hw4.html">HW#4: sws, milestone#2</a></li>
simple shell</a></li>
-->
	</ul>
	</p>
	<p>
	The following exercises are not graded, but
	are recommended to be completed before or soon after
	the given lecture to help you better understand the
	concepts dicussed.
	</p>
	<p>
	<ul>
	<li><a href="fixme-exercise.html">Lecture 01 - Generic Warmup Exercise</a></li>
	<li><a href="compare-code-exercise.html">Lecture 01 - Compare Code Exercise</a></li>
	<li><a href="fd-exercise.html">Lecture 02 - File Descriptor Warmup Exercise</a></li>
	<li><a href="compare-stat.html">Lecture 03 - Compare <tt>stat(1)</tt> Exercise</a></li>
	<li><a href="cd-exercise.html">Lecture 04 - File System Exercise: Implement the cd(1) and pwd(1) commands</a></li>
	<li><a href="stack-exercise.html">Lecture 06 - Process Execution Exercise: Inspect the call stack</a></li>
	<li><a href="startup-exercise.html">Lecture 06 - Program Startup Exercise</a></li>
	<li><a href="env-exercise.html">Lecture 06 - Environment Exercise</a></li>
	<li><a href="siggot-exercise.html">Lecture 07 - Play the Signals Game of Thrones</a></li>
	<li><a href="code-reading-exercise.html">Lecture 10 - HTTP Code Reading</a></li>
	<li><a href="libgreet-exercise.html">Lecture 11 - libgreet</a></li>
	<li><a href="aed-exercise.html">Lecture 12 - write a tool to encrypt/decrypt data using AES</a></li>
	</ul>
	</p>
	<hr>
        <H3><A name="midterm">Midterm</A> Project:</H3>
	<p>Implement the "<a href="ls.pdf">ls(1)</a>" command as
        decribed in the manual page provided to you.
        See the full <A href="f20-midterm.html">midterm project
        description</A> for details.</P>

	<hr>
        <H3><A name="group-project">Group</A> Project:</H3>
        <p>Implement the "<a href="sws.1.pdf">sws(1)</a>" command as
        decribed in the manual page provided to you.
        See the full <A href="f19-group-project.html">group project
        description</A> for details.</P>

	<!--
	<hr>
        <H3><A name="final-exam">Final Exam</A>:</H3>
	<p>Details to be announced.</p>
        In 2012, we had a take-home
        <a href="final-F2012.txt">final</a>.  The final may differ in the coming semester.
	-->
	<hr>
        <H3><A name="syllabus">Syllabus</A>:</H3>

	Homework assignments, slides, and other material listed below are
	from the previous semester.  We will update the content as the
	semester progresses.
        <TABLE width="100%" border="1" cellpadding="5">
          <TR>
            <TH>Date</TH>

            <TH>Topic</TH>

            <TH>Reading</TH>

            <TH>Links</TH>

          </TR>

          <TR>
            <TD>2020-08-31</TD>

            <TD>Introduction, UNIX history, UNIX Programming
            Basics</TD>

            <TD>Stevens: Chapters 1, 2<br>
		<a href="https://www.netmeister.org/book/02-unix.pdf">Unix history and basic features</a></TD>

            <TD nowrap="nowrap">
			<b>Week 01, Segment 1: Introduction</b><br>
			[<a href="01-introduction.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/BsB9Cg6yJc4">video lecture</a>]&nbsp;[<a href="01-introduction.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 01, Segment 2: UNIX History</b><br>
			[<a href="01-history.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/3H7SQWTR6Dw">video lecture</a>]&nbsp;[<a href="01-history.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 01, Segment 3: UNIX Basics</b><br>
			[<a href="01-basics.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/w3spRzZ8bSA">video lecture</a>]&nbsp;[<a href="01-history.txt">transcript</a>]<br>
            &#160;<BR>
            <A href="simple-cat.c">simple-cat.c</A><BR>
            <A href="simple-ls.c">simple-ls.c</A><BR>
            <A href="simple-shell.c">simple-shell.c</A><BR>
            <A href="simple-shell2.c">simple-shell2.c</A><br>
            <A href="welcome.c">welcome.c</A><BR><br>
<!--            <a href="intro.html">Intro</a><br>
	    <a href="f16-hw1.html">HW#1</a></TD> -->
	    </TD>
          </TR>

          <TR>
            <TD>2020-09-07</TD>
            <TD colspan="3"><em>Labor Day Holiday</em></TD>
          </TR>

          <TR>
            <TD>2020-09-14</TD>

            <TD>File I/O, File Sharing</TD>

            <TD>Stevens: Chapter 3</TD>

            <TD nowrap="nowrap">
			<b>Week 02, Segment 1: File Descriptors</b><br>
			[<a href="02-fds.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/h5A1OQjuCqk">video lecture</a>]&nbsp;[<a href="02-fds.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 02, Segment 2: open(2)/close(2)</b><br>
			[<a href="02-open-close.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/QnL4eYpb5Iw">video lecture</a>]&nbsp;[<a href="02-open-close.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 02, Segment 3: read(2)/write(2)/lseek(2)</b><br>
			[<a href="02-read-write-lseek.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/EUUPw8MOV_A">video lecture</a>]&nbsp;[<a href="02-read-write-lseek.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 02, Segment 4: File Sharing</b><br>
			[<a href="02-file-sharing.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/CAbUtc86ULw">video lecture</a>]&nbsp;[<a href="02-file-sharing.txt">transcript</a>]<br>
            &#160;<BR>
            <A href="argv.c">argv.c</A><BR>
            <A href="fds.c">fds.c</A><BR>
            <A href="hole.c">hole.c</A><BR>
            <A href="lseek.c">lseek.c</A><BR>
            <A href="openex.c">openex.c</A><BR>
            <A href="openmax.c">openmax.c</A><BR>
            <A href="redir.c">redir.c</A><BR>
            <A href="rwex.c">rwex.c</A><BR>
            <A href="sync-cat.c">sync-cat.c</A><BR><br>
            <a href="f20-hw1.html">HW1</a>: <A href="bbcp.1.pdf">bbcp(1)</A></td>
          </TR>

          <TR>
            <TD>2020-09-21</TD>

            <TD>Files and Directories</TD>

            <TD>Stevens: Chapter 4</TD>

            <TD nowrap="nowrap">
			<b>Week 03, Segment 1: stat(2) intro</b><br>
			[<a href="03-stat.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/veFwXrEHPsk">video lecture</a>]&nbsp;[<a href="03-stat.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 03, Segment 2: UIDs intro</b><br>
			[<a href="03-uids.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/YlcF3ncTQpo">video lecture</a>]&nbsp;[<a href="03-uids.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 03, Segment 3: struct stat st_mode</b><br>
			[<a href="03-perms.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/vS6abFjN3ZY">video lecture</a>]&nbsp;[<a href="03-perms.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 03, Segment 4: chmod(2) and chown(2)</b><br>
			[<a href="03-chmod-chown.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/5MJmCanZDyk">video lecture</a>]&nbsp;[<a href="03-chmod-chown.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 03, Segment 5: umask(2)</b><br>
			[<a href="03-umask.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/bRAR2bv2HSM">video lecture</a>]&nbsp;[<a href="03-umask.txt">transcript</a>]<br>
            &#160;<BR>

            &#160;<BR>
            <A href="access.c">access.c</A><BR>
            <A href="chmod.c">chmod.c</A><BR>
            <A href="chown.c">chown.c</A><BR>
            <A href="myuids.c">myuids.c</A><BR>
            <A href="setuid.c">setuid.c</A><BR>
            <A href="size.c">size.c</A><BR>
            <A href="simple-ls.c">simple-ls.c</A><BR>
            <A href="simple-ls-stat.c">simple-ls-stat.c</A><BR>
            <A href="umask.c">umask.c</A><BR>
	    <a href="f20-midterm.html">Midterm Project Assignment</a></TD>
          </TR>

          <TR>
            <TD>2020-09-28</TD>

            <TD>Filesystems, System Data Files, Time &amp;
            Date</TD>

            <TD>Stevens: Chapter 4, 6<br>
		<a
href="https://www.netmeister.org/book/04-file-systems.pdf">File Systems and Storage Models</a>: 4.4.1, 4.5 - 4.7</TD>

            <TD nowrap="nowrap">
			<b>Week 04, Segment 1: The Unix Filesystem</b><br>
			[<a href="04-ufs.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/kY4JAXYyByQ">video lecture</a>]&nbsp;[<a href="04-ufs.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 2: Links</b><br>
			[<a href="04-links.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/0l8o2goJ1kc">video lecture</a>]&nbsp;[<a href="04-links.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 3: Directories</b><br>
			[<a href="04-dirs.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/xZ7dNXZ58G8">video lecture</a>]&nbsp;[<a href="04-dirs.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 4: Directory Size</b><br>
			[<a href="04-dirsize.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/gY0SE-71LZA">video lecture</a>]&nbsp;[<a href="04-dirsize.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 5: /etc/passwd</b><br>
			[<a href="04-etc-passwd.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/fv16TWDnLYM">video lecture</a>]&nbsp;[<a href="04-etc-passwd.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 6: getpwuid(2) and /etc/groups</b><br>
			[<a href="04-getpwuid.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/aomkx6_aWpc">video lecture</a>]&nbsp;[<a href="04-getpwuid.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 7: atime, mtime, ctime</b><br>
			[<a href="04-amctimes.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/ffYEEj5vnlw">video lecture</a>]&nbsp;[<a href="04-amctimes.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 04, Segment 8: time(3) is an illusion</b><br>
			[<a href="04-time.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/3N2aH1vUacQ">video lecture</a>]&nbsp;[<a href="04-time.txt">transcript</a>]<br>
            &#160;<BR>
            &#160;<BR>
	    <a href="cd.c">cd.c</A><BR>
	    <a href="getpw.c">getpw.c</A><BR>
	    <a href="groups.c">groups.c</A><BR>
            <A href="wait-unlink.c">wait-unlink.c</A><BR>
            <A href="sizeof.c">sizeof.c</A><BR>
            <A href="time.c">time.c</A><BR></td>
          </TR>

          <TR>
            <TD>2020-10-05</TD>

            <TD>UNIX tools: cc(1), make(1), revision control, diff(1), patch(1), gdb(1)</TD>

            <TD><A href=
            "http://www.cvshome.org/docs/manual/cvs-1.11.6/cvs.html">
            CVS Documentation</A>
          <A href="http://sourceware.org/gdb/current/onlinedocs/gdb/">
            Debugging with GDB</A><BR>
            <A href=
            "http://heather.cs.ucdavis.edu/~matloff/UnixAndC/CLanguage/Debug.html">
            Guide to Faster, Less Frustrating Debugging</A><BR>
            <A href=
            "http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html">gdb
            Tutorial</A><br>
		<a href="http://git-scm.com/">Git</a></TD>
            <TD><A href="lecture05.pdf">Lecture Slides</A><BR>
            <BR>
	    <A href="compilechain/">compile chain examples</a><br>
	    <A href="make-examples/">make examples</a><br>
	    <A href="gdb-examples/">gdb examples</a><br><br>
          </TR>

          <TR>
            <TD>2020-10-12</TD>
            <TD colspan="3"><em>Fall Recess</em></TD>
          </TR>

          <TR>

            <TD>2020-10-13</TD>

            <TD>Process Environment, Process Control</TD>

            <TD>Stevens: Chapters 7, 8<br>
		<a
href="https://insecure.org/stf/smashstack.html">Smashing The Stack For Fun And Profit</a><br>
		<a
href="http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html">Linux x86 Program Start Up</a><br>
		<a
href="https://www.netmeister.org/blog/stdarg.html"><tt>stdarg</tt> And The Case Of The Forgotten Registers</a></TD>

            <TD nowrap="nowrap"><em>Note: Tuesday Class</em><br><br>
			<b>Week 06, Segment 1: Memory Layout of a Process</b><br>
			[<a href="06-memory-layout.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/aHmcowhoOzU">video lecture</a>]&nbsp;[<a href="06-memory-layout.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 06, Segment 2: Program Startup</b><br>
			[<a href="06-program-start.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/Yul4d-BDdx8">video lecture</a>]&nbsp;[<a href="06-program-start.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 06, Segment 3: Program Termination</b><br>
			[<a href="06-program-termination.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/xNeEw1f_js8">video lecture</a>]&nbsp;[<a href="06-program-termination.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 06, Segment 4: The Environment</b><br>
			[<a href="06-env.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/8DEPA6nJXNY">video lecture</a>]&nbsp;[<a href="06-env.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 06, Segment 5: Process Limits and Identifiers</b><br>
			[<a href="06-limits-pids.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/bnki8QKjSfQ">video lecture</a>]&nbsp;[<a href="06-limits-pids.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 06, Segment 6: Process Control</b><br>
			[<a href="06-process-control.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/KJq5nTCFsIg">video lecture</a>]&nbsp;[<a href="06-process-control.txt">transcript</a>]<br>
            &#160;<BR>
            &#160;<BR>
            <a href="testcp.sh">testcp.sh</a><BR>
            <A href="const.c">const.c</A><BR>
            <A href="entry.c">entry.c</A><BR>
            <A href="exit-handlers.c">exit-handlers.c</A><BR>
            <A href="forkflush.c">forkflush.c</A><BR>
            <A href="forkseek.c">forkseek.c</A><BR>
            <A href="hw.c">hw.c</A><BR>
            <A href="malloc.c">malloc.c</A><BR>
            <A href="memory-layout0.c">memory-layout0.c</A><BR>
            <A href="memory-layout1.c">memory-layout1.c</A><BR>
            <A href="memory-layout2.c">memory-layout2.c</A><BR>
            <A href="memory-layout3.c">memory-layout3.c</A><BR>
            <A href="memory-layout4.c">memory-layout4.c</A><BR>
            <A href="memory-layout5.c">memory-layout5.c</A><BR>
            <A href="memory-layout6.c">memory-layout6.c</A><BR>
            <A href="memory-layout7.c">memory-layout7.c</A><BR>
            <A href="memory-layout8.c">memory-layout8.c</A><BR>
            <A href="sum.c">sum.c</A><BR>
            <A href="zombies.c">zombies.c</A><br><br>
	    <a
href="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/common/crt0-common.c?rev=HEAD&content-type=text/x-cvsweb-markup">NetBSD crt0-common.c</a><br>
            <!-- <A href="setjmp1.c">setjmp1.c</A><BR>
            <A href="setjmp2.c">setjmp2.c</A><BR>
            <A href="setjmp3.c">setjmp3.c</A> --></TD>
          </TR>

          <TR>

            <TD>2020-10-19</TD>
            <TD>Process Groups, Sessions, Signals</TD>

            <TD>Stevens: Chapter 9, 10<br>
		<a
href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html#tag_11">POSIX
Terminal Interface Description</a><br>
		<a href="https://notes.shichao.io/apue/ch9/">Shichao's Notes</a><br>
		<a
href="http://www.informit.com/articles/article.aspx?p=366888&seqNum=7">FreeBSD Process Management</a> (from "The Design and Implementation of the FreeBSD Operating System")</td>

            <TD width="25%">
			<b>Week 07, Segment 1: The Login Process</b><br>
			[<a href="07-login-process.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/eNYTJbmYzH8">video lecture</a>]&nbsp;[<a href="07-login-process.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 07, Segment 2: Process Groups and Sessions</b><br>
			[<a href="07-process-groups-and-sessions.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/NfHqGv0PlIw">video lecture</a>]&nbsp;[<a href="07-process-groups-and-sessions.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 07, Segment 3: Job Control</b><br>
			[<a href="07-job-control.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/l6-663i8bwQ">video lecture</a>]&nbsp;[<a href="07-job-control.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 07, Segment 4: Signals</b><br>
			[<a href="07-signals.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/Vh7rBGj0Ty4">video lecture</a>]&nbsp;[<a href="07-signals.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 07, Segment 5: Reentrant and Interrupted Functions</b><br>
			[<a href="07-reentrant.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/0GRLhpMao3I">video lecture</a>]&nbsp;[<a href="07-reentrant.txt">transcript</a>]<br>
            &#160;<BR>
            &#160;<BR>
	    <a href="eintr.c">eintr.c</a><br>
	    <a href="pending.c">pending.c</a><br>
            <a href="reentrant.c">reentrant.c</a><br>
            <a href="signals1.c">signals1.c</a><br>
            <a href="signals2.c">signals2.c</a><br>
            <a href="signals3.c">signals3.c</a><br>
            <a href="signals4.c">signals4.c</a><br>
            <A href="sigusr.c">sigusr.c</A></TD>
          </TR>

          <TR>
            <TD>2020-10-26</TD>
            <TD>Interprocess Communication I</TD>
            <TD>Stevens: Chapter 14<br>
		<A href="https://web.archive.org/web/20160507131726/http://www.kohala.com/start/unpv22e/unpv22e.chap12.pdf">Shared Memory Introduction</A><BR>
		<a href="https://web.archive.org/web/20180316204322/http://www.linuxdevcenter.com/pub/a/linux/2007/05/24/semaphores-in-linux.html">Semaphores in Linux</a><br>
		<a href="https://www.softprayog.in/programming/interprocess-communication-using-posix-message-queues-in-linux">Interprocess communication using POSIX message queues in Linux</a>
		</td>
            <TD width="25%">
			<b>Week 08, Segment 1: Interprocess Communications Intro</b><br>
			[<a href="08-ipc-intro.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/JHV2dsGZUzk">video lecture</a>]&nbsp;[<a href="08-ipc-intro.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 08, Segment 2: System V IPC</b><br>
			[<a href="08-sysv-ipc.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/hTUquvhWysA">video lecture</a>]&nbsp;[<a href="08-sysv-ipc.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 08, Segment 3: Pipes and FIFOs</b><br>
			[<a href="08-pipes.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/mq5G33Sbc_o">video lecture</a>]&nbsp;[<a href="08-pipes.txt">transcript</a>]<br>
            &#160;<BR>
            <BR>
            <A href="ipctut.pdf">BSD IPC Tutorial</A><BR>
		<a
href="https://beej.us/guide/bgipc/html/single/bgipc.html">Beej's
Guide to Unix IPC</a><br>
            <BR>
            <a href="memory-layout.c">memory-layout.c</a><br>
            <a href="mqrecv.c">mqrecv.c</a><br>
            <a href="mqsend.c">mqsend.c</a><br>
            <a href="msgrecv.c">msgrecv.c</a><br>
            <A href="pipe1.c">pipe1.c</A><BR>
            <A href="pipe2.c">pipe2.c</A><BR>
            <a href="popen.c">popen.c</a><br>
            <a href="semdemo.c">semdemo.c</a><br>
            <a href="shmdemo.c">shmdemo.c</a><br>
	<br>
	<a href="f20-hw2.html">HW#2: implement 'command(3)'</a><br>
		</TD>
          </TR>

          <TR>
            <TD>2020-11-02</TD>

            <TD>Interprocess Communication II</TD>

            <TD>Stevens: Chapter 14<br>
            	<A href="ipc.pdf">BSD IPC</A><BR>
		<a href="https://ops.tips/blog/how-linux-creates-sockets/">How Linux creates sockets and counts them</a><br>
		<a href="https://ops.tips/blog/how-linux-tcp-introspection/">How Linux allows TCP introspection</a><br></TD>

            <TD width="25%">
			<b>Week 09, Segment 1: <tt>socketpair(2)</tt></b><br>
			[<a href="09-socketpair.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/w6Au54pVt-8">video lecture</a>]&nbsp;[<a href="09-socketpair.txt">transcript</a>]<br>
            &#160;<BR>
			<b>Week 09, Segment 2: <tt>socketpair(2)</tt></b><br>
			[<a href="09-sockets-local.pdf">slides</a>]&nbsp;[<a href="https://youtu.be/7LoLt49oB9A">video lecture</a>]&nbsp;[<a href="09-sockets-local.txt">transcript</a>]<br>
            &#160;<BR>
            <BR>
            <A href="socketpair.c">socketpair.c</A><BR>
            <A href="udgramread.c">udgramread.c</A><BR>
            <A href="udgramsend.c">udgramsend.c</A><BR>
            <A href="dgramread.c">dgramread.c</A><BR>
            <A href="dgramsend.c">dgramsend.c</A><BR>
            <A href="streamread.c">streamread.c</A><BR>
            <A href="streamwrite.c">streamwrite.c</A><BR>
            <A href="strchkread.c">strchkread.c</A><br>
		<br>
	    <a href="f19-group-project.html">Group Project Assignment</a><br>
	    </TD>
          </TR>

          <TR>
            <TD>2020-11-09</TD>

            <TD>HTTP / Group Project Discussions</TD>
<!-- Code Reading / HTTP Server Implementations</TD>

            <TD><a href="http://www.eterna.com.au/bozohttpd/">bozohottpd</a><br>
		<a href="http://www.acme.com/software/mini_httpd/">mini_httpd</a><br><br>
		<a href="https://httpd.apache.org/download.cgi">apache</a><br>
		<a href="https://www.lighttpd.net/download/">lighttpd</a><br>
		<a href="https://nginx.org/en/download.html">nginx</a><br>
		<a href="http://www.mathopd.org/download.html">mathopd</a><br>
		<a href="http://nullhttpd.sourceforge.net/httpd/">null httpd</a><br>
		<a href="http://inglorion.net/software/muhttpd/">muhttpd</a><br>
		Too tiny indeed: <a href="http://tinyhttpd.sourceforge.net/">tinyhttpd</a><br> -->
		<TD>&nbsp;
		</TD>

            <TD><a href="lecture10.pdf">Lecture Slides</a></TD>
  
          </TR> 

          <TR>
            <TD>2020-11-16</TD>

            <TD><a name="daemon"></a>D&aelig;mon Processes, Shared Libraries</TD>

            <TD>Stevens: Chapter 13</TD>

            <TD width="25%"><a href="lecture11.pdf">Lecture Slides</a><br>
		<a
href="http://jvns.ca/blog/2014/09/06/how-to-read-an-executable/">How to read an Executable</a><br>
		<a href="https://lwn.net/Articles/276782/">Ian Lance Taylor's blog post series on linkers</a><br>
		<a href="https://www.iecc.com/linker/">Linkers and Loaders</a><br>
		<a href="https://www.akkadia.org/drepper/dsohowto.pdf">How To Write Shared Libraries</a><br>
		<a href="elf.html">The Executable and Linkable Format (ELF)</a><br><br>
		<a href="dlopenex.c">dlopenex.c</a><br>
		<a href="evil.c">evil.c</a><br>
		<!-- <a href="greet.h">greet.h</a><br>
		<a href="greet.c">greet.c</a><br> -->
		<a href="hello.c">hello.c</a><br>
		<a href="ldtest1.2.c">ldtest1.2.c</a><br>
		<a href="ldtest1.c">ldtest1.c</a><br>
		<a href="ldtest2.c">ldtest2.c</a><br>
		<a href="main.c">main.c</a><br>
		<a href="setget.c">setget.c</a><br>
	        <a href="libgreet-exercise.html">libgreet exercise</a></td>
          </TR>
          <TR>
            <TD>2020-11-23</TD>

            <TD>Advanced I/O: Nonblocking I/O, Polling, and Record
            Locking / Encryption in a Nutshell</TD>

            <TD>Stevens: Chapter 14</TD>

            <TD width="25%"><A href="lecture12.pdf">Lecture
            Slides</A><BR>
            <BR>
            <A href="nonblock.c">nonblock.c</A><br>
            <A href="flock.c">flock.c</A><br><br>
	    <!-- <a href="f16-hw4.html">HW4</a> -->
	</TD>
          </TR>

          <TR>
            <TD>2020-11-30</TD>
            <TD>Restricting processes / Containers</TD>
            <TD>&nbsp;</TD>
            <TD><a href="lecture13.pdf">Lecture Slides</a><br>
		<a href="https://www.netmeister.org/blog/restricting-processes.html">Course
Notes</a><br><br>
		<a href="break-chroot.c">break-chroot.c</a><br>
		<a href="priority.c">priority.c</a><br>
		<a href="mkchroot">mkchroot</a></TD>
          </TR>

          <TR>
            <TD>2020-12-07</TD>

            <TD>Review</TD>

            <TD>&nbsp;</TD>

            <TD><A href="lecture14.pdf">Lecture Slides</a><br><br>
		<a href="f19-sish.html">Final Assignment: sish(1)</a></TD>
          </TR>

        </TABLE>
      </TD>
    </TR>
  </TABLE>
</BODY>
</HTML>
